<template>
  <div class="user-profile-container">
    <div v-if="likedBlogs.length === 0">没有点赞的博客</div>
    <div v-for="blog in likedBlogs" :key="blog.id" class="liked-blog-item">
    <img :src="blog.image" alt="Blog Image" v-if="blog.image" style="width: 100px; margin: 30px 20px;"/>
      <h4>{{ blog.title }}</h4>
      <p>{{ blog.content }}</p>
      <router-link :to="`/blog/${blog.id}`">查看详情</router-link>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import life3 from "../images/life-3.jpg"
// 模拟用户点赞的博客数据
const likedBlogs = ref([
{ id: 1, content: '原来追星会不远万里一个人来不熟悉的城市 ​​' ,image:life3},
]);
</script>

<style scoped>
.user-profile-container {
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
}
</style>
